using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Runtime.Serialization;
using Arch.Aspects;
using Arch.Model;

namespace Arch.Samples.Model
{
    [DataContract(IsReference = true)]
    [
        Order("Username"),
        SecurityAccess(ReadRoles = "Admin", WriteRoles = "Admin"),
    ]
    public partial class User : Entity<int>
    {
        [DataMember]
        public virtual string Username { get; set; }

        [
       //     Association("Todo_User", "Id", "CreationUserId"),
            Display(AutoGenerateField = false),
        ]
        public virtual ICollection<Todo> Todoes { get; set; }

        public override string ToString()
        {
            return Username;
        }
    }
}
